
/**
 * Copyright 2009 cestum.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
package org.waveprotocol.wave.model.document.operation.automaton.doc {
import org.waveprotocol.wave.model.document.operation.Attributes;
import org.waveprotocol.wave.model.document.operation.automaton.AutomatonDocument;
import org.waveprotocol.wave.model.document.operation.impl.AnnotationMap;
import org.waveprotocol.wave.model.document.operation.impl.AnnotationMapImpl;
import org.waveprotocol.wave.model.util.Preconditions;

public class EmptyAutomationDoc implements AutomatonDocument {

    
    public function annotationsAt(pos:int):AnnotationMap {
      return AnnotationMapImpl.EMPTY_MAP;
    }

    
    public function attributesAt(pos:int):Attributes {
      return null;
    }

    
    public function charAt(pos:int):int {
      return -1;
    }

    
    public function elementEndingAt(pos:int):String {
      return null;
    }

    
    public function elementStartingAt(pos:int):String {
      return null;
    }

    
    public function length():int {
      return 0;
    }

    
    public function nthEnclosingElementTag(insertionPoint:int, depth:int):String {
      return null;
    }

    
    public function remainingCharactersInElement(insertionPoint:int):int {
      return 0;
    }

    
    public function getAnnotation(pos:int, key:String):String {
      return null;
    }

    
    public function firstAnnotationChange(start:int, end:int, key:String, fromValue:String):int {
      Preconditions.checkPositionIndexes(start, end, 0);
      // if (fromValue != null && end > start): can't happen since end == start == 0
      return -1;
    }
  
}
}